using System;
using System.Collections.Generic;
using System.Text;

namespace BackGroundWorkerTry
{
    class Search
    {
    }

    class Vehicle:IComparable
    {
        private string _vehicleName;
        private int _maxSpeed;

        public int MaxSpeed
        {
            get { return _maxSpeed; }
            set { _maxSpeed = value; }
        }   
	
        public string Name
        {
            get { return _vehicleName; }
            set { _vehicleName = value; }
        }
	
        #region IComparable Members

        public int CompareTo(object obj)
        {
            if (!(obj is Vehicle))
                throw new Exception("You can only compare vehicle Types");
            else
            {
                Vehicle _vObj = (Vehicle)obj;
                if (this.Name == _vObj.Name)
                    return 1;
                else
                    return -1;
            }
        }

        #endregion
    }
}
